﻿using Wolfpack.Core.Configuration;
using Wolfpack.Core.Interfaces.Entities;
using Wolfpack.Core;
using Wolfpack.Core.Notification.Filters.Request;

namespace Wolfpack.Contrib.Checks.NServiceBusPerformanceCounters
{
    public class NServiceBusSLAConfigurationDiscovery : HealthCheckDiscoveryBase<NServiceBusSLAViolationCounterCheckConfig, NServiceBusSLAViolationCounterCheck>
    {
        protected override NServiceBusSLAViolationCounterCheckConfig GetConfiguration()
        {
            return new NServiceBusSLAViolationCounterCheckConfig
                       {
                           Enabled = true,
                           FriendlyId = "CHANGEME!",
                           InstanceName = "TODO: Set Queue Name",
                           MachineName = "leave blank for localhost or remote machine name",
                           NotificationMode = StateChangeNagFailNotificationFilter.FilterName,
                           NotificationThreshold = 10000
                       };
        }

        protected override void Configure(ConfigurationEntry entry)
        {
            entry.Name = "NSB-SLA-Monitor";
            entry.Description = "Reports the NServiceBus SLA violation counter for a specific queue. The SLA Violation Counter acts as a early warning system that tells you the number of seconds left until the SLA for the particular endpoint is breached.";
            entry.Tags.AddIfMissing("NServiceBus", "SLA");
        }
    }
}